//
//  GLEnemy.m
//  QAQ打飞机
//
//  Created by admin on 15/9/1.
//  Copyright (c) 2015年 gl. All rights reserved.
//
//敌机模型
#import "GLEnemy.h"


@implementation GLEnemy
+(id)enemyWithTyep:(GLEnemytype)tyep area:(CGRect)gameArep size:(CGSize)size
{
    GLEnemy *b =[[GLEnemy alloc]init];
    b.type =tyep;
    b.size =size;
    CGFloat x =arc4random_uniform(gameArep.size.width-size.width)+size.width/2.0;
    CGFloat y =-size.height/2.0;
    b.position =CGPointMake(x, y);
    switch (b.type) {
        case kEnemySmall:
            b.hp =1;
            b.speed =arc4random_uniform(4)+2;
            b.score=1;
            break;
        case kEnemyMid:
            b.hp =10;
            b.speed =arc4random_uniform(3)+2;
            b.score=10;
            break;
        case kEnemyBig:
            b.hp =30;
            b.speed =2;
            b.score=30;
            break;
        default:
            break;
    }
    b.bBlowup=NO;
    b.blowupFrames =0;
    return b;





}




@end
